let fs = require('fs');
console.time('file');
let obj={
    createFile:function(filename,string){
        fs.writeFileSync(filename,string);
    },
    createRandom:function(num){
        return (Math.ceil(Math.random()*num)+1)
    },
    init:function(){
        for(let i= 1;i<=1000;i++){
            let filename="./file/"+i+".txt";
            let num=this.createRandom(1000);
            this.createFile(filename,num+"");
        }
    }
}
obj.init();
console.timeEnd('file');